﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Castle.MicroKernel.Registration;
using Mammoth.Services;

namespace Mammoth.Factories
{
    public class InstallerFactory
    {
        MammothConfig config;

        public InstallerFactory()
        {
            config = MammothConfig.Load();
        }

        public IWindsorInstaller[] GetInstaller()
        {
            var list = new List<IWindsorInstaller>();
            list.Add(new ViewInstaller());
            list.Add(new ViewModelInstaller());
            list.Add(new ServiceInstaller());
            if (config.MockService)
                list.Add(new MockExpensiveServiceInstaller());
            else
                list.Add(new ExpensiveServiceInstaller());
            return list.ToArray();
        }
    }
}
